package com.itasura.bridge;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author sailor wang
 * @date 2018/9/11 下午2:14
 * @description
 */
public class Hammer implements Weapon {

    private static final Logger LOGGER = LoggerFactory.getLogger(Hammer.class);

    private Enchantment enchantment;

    public Hammer(Enchantment enchantment) {
        this.enchantment = enchantment;
    }

    @Override
    public Enchantment getEnchantment() {
        return this.enchantment;
    }

    @Override
    public void wield() {
        LOGGER.info("雷神之锤已唤醒。。。");
        enchantment.onActivate();
    }

    @Override
    public void swing() {
        LOGGER.info("挥舞神锤。。。");
        enchantment.apply();
    }

    @Override
    public void unwield() {
        LOGGER.info("神锤钝了。。。");
        enchantment.onDeactivate();
    }
}